import React from 'react';
import { View, TouchableOpacity, Text } from 'react-native';
import styles from './style';
import { Actions } from 'react-native-router-flux';

export default ({ members, policies, customerId, customerName }) => {
  return (
    <View style={styles.familyEntry}>
      <TouchableOpacity
        style={[styles.familyBtn]}
        onPress={() => Actions.familyMembersList({ customerId, customerName })}
      >
        <Text style={styles.familyBtnCount}>{members}</Text>
        <Text style={styles.familyBtnTitle}>家庭成员数</Text>
      </TouchableOpacity>
      <TouchableOpacity
        style={[styles.familyBtn, { borderLeftWidth: 1, borderLeftColor: '#eee' }]}
        onPress={() => Actions.familyPolicyList({ customerId, customerName })}
      >
        <Text style={styles.familyBtnCount}>{policies}</Text>
        <Text style={styles.familyBtnTitle}>家庭保单数</Text>
      </TouchableOpacity>
    </View>
  );
};
